<?xml version='1.0' encoding='UTF-8' ?>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<f:view>
	<h:head>
		<title>Login</title>
		<h:outputStylesheet library="css" name="styles.css" />
		<h:outputScript library="js" name="md5.js" />
		<script type="text/javascript">
			function passwordToMD5() {
				document.getElementById('frmLogin:txtPasswordMD5').value = hex_md5(document
						.getElementById('frmLogin:txtPassword').value);
			}
		</script>
	</h:head>
	<h:body>
		<h:form id="frmLogin">
			<p:growl id="messages" showDetail="true" sticky="true"/>
			<table class="tblLoginStyle">
				<tr>
					<td></td><td></td><td></td>
				</tr>
				<tr>
					<td></td>
					<td class="tdLogin">
						<h:outputLabel id="lblLogin" value="Login:" styleClass="lbl"/>
						<h:inputText id="txtLogin" value="#{loginBean.user.login}" styleClass="txt"/>
						<br/>
						<h:outputLabel id="lblPassword" value="Senha:" styleClass="lbl"/>
						<h:inputSecret id="txtPassword" styleClass="txt">
							<f:validateLength minimum="1" />
						</h:inputSecret>
						<h:inputHidden id="txtPasswordMD5"
							value="#{loginBean.user.password}"></h:inputHidden>
						<br/>
						<br/>
						<p:commandLink id="btnLogin" styleClass="btnLoginStyle"
							action="#{loginBean.onLoginClick}" onclick="passwordToMD5();" update=":frmLogin:messages"/>
					</td>
					<td></td>
				</tr>
				<tr>
					<td></td>
					<td></td>
					<td></td>
				</tr>
			</table>
		</h:form>
	</h:body>
</f:view>
</html>